package dongshi.daddy.responsibilitychain.uml;

public class ConcreteHandler2 extends Handler {
    @Override
    public void handleRequest(String request) {
        /*if (request.equals("one")) {
            System.out.println("具体处理者1负责处理该请求！");
        } else {
            if (getNext() != null) {
                getNext().handleRequest(request);
            } else {
                System.out.println("没有人处理该请求！");
            }
        }*/
        System.out.println("处理者2号Handler处理请求: " + request);
        Handler next;
        if ((next = getNext()) != null) {
            next.handleRequest(request);
        } else {
            System.out.println("没有其他handler了，处理请求结束！");
        }
    }
}
